#ifndef __ANIMATIONALGO_H__
#define __ANIMATIONALGO_H__	//


#include <AntTweakBar.h>

#include "Application.h"

#include "AnimatedChain.h"
#include "AnimationBar.h"

class AnimationBar;
class AnimationAlgo: public Application
{
public:
	AnimationAlgo();

	~AnimationAlgo(){}

	bool OnInit();

	void OnRender();

	void OnRelease();

	void ComputeChain(double t);
	void ComputeChain(Joint * j);

	double time;	// enlapsed time
	double tpstot;
	bool running;
	double start;
	double stop;
    double speed;


protected:

    void findNext(float angle, float distance);
    std::string bvhdirectorie;

    std::vector<InfoChain*> chainsInfo;


	Mesh*	m_perso, *m_save;
	double		m_turn	;	// Model turn counter

    AnimatedChain * chain;
    InfoChain * chainInfo;

    AnimatedChain * defaultchain;
    InfoChain * defaultchainInfo;

    AnimatedChain * nextchain;
    InfoChain * nextchainInfo;

    Quaternion rotatrel;
    Vector3 rotorigin;
    Vector3 transrel;
    float bustorrel;

    Vector3 target;

	AnimationBar * m_bar;
};


#endif // __TPAnimation_H__ fin de la routine
